//
//  YXYWallPaperModel.m
//  Topit
//
//  Created by dllo on 15/12/9.
//  Copyright © 2015年 YXY. All rights reserved.
//

#import "YXYWallPaperModel.h"

@implementation YXYWallPaperModel
- (void)dealloc {
    [_name release];
    [_more release];
    [_itemArray release];
    [super dealloc];
}
- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"item"]) {
        NSArray *array = value;
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in array) {
            YXYWallItemModel *wallItemModel = [[YXYWallItemModel alloc] initWithDictionary:dic];
            [mutableArray addObject:wallItemModel];
            [wallItemModel release];
        }
        self.itemArray = [NSArray arrayWithArray:mutableArray];
    }
}
@end
